package com.springboot.demo.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Data
@AllArgsConstructor
@NoArgsConstructor

@Component//spring的组件 spring帮我们创建该对象，并初始化

public class Book {

    @Value("${book.name}")
    private String name;
    @Value("${book.author}")
    private String author;
}